import http from '@/utils/http';
import type { EngineeringPhase } from "./type";

/**
 * 获取表格数据
 */
export const getBuildStageTaskList = (portraitId: string,query:{status:number}) => {
    return http.get(`/crm/build/taskTemplate/getBuildStageTaskList/${portraitId}`,query);
};
/**
 * 选择工程阶段列表
 */
export const getEngineeringPhaseList = (portraitId: string) => {
    return http.get<EngineeringPhase[]>(`/crm/build/taskTemplate/buildStageList/${portraitId}`);
};

/**
 * 取消阶段勾选校验
 */
export const cancelCheck = (portraitId: string, stageSettingId: string) => {
    return http.get(`/crm/build/taskTemplate/cancelBuildStage/${portraitId}/${stageSettingId}`);
};
/**
 * 删除阶段校验
 */
export const deleteCheck = ( stageSettingId: string) => {
    return http.get(`/crm/build/taskTemplate/deleteStageVerifi/${stageSettingId}`);
};

/**
 * 删除阶段
 */
export const deleteStageItem = (stageSettingId: string) => {
    return http.get(`/crm/build/taskTemplate/deleteStage/${stageSettingId}`);
};

/**
 * 保存阶段列表
 */
export const saveStageList = (portraitId:string,data:EngineeringPhase[]) => {
    return http.post(`/crm/build/taskTemplate/addBuildStage/${portraitId}`, data);
};

/**
 * /crm/system/stage修改启用禁用
 */
export const updateStageStatus = (data:EngineeringPhase) => {
    return http.post(`/crm/system/stage`, data);
};